package zgc.demo.consumer.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import zgc.demo.consumer.entity.Goods;

@Service
public class OrderService {

    @Autowired
    private RestTemplate restTemplate;

    public Goods getGoodsById(String goodsId) {
        String url = "http://127.0.0.1:8080/goods/getGoodsById/" + goodsId;
        return restTemplate.getForObject(url, Goods.class);
    }
}
